package com.lp.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lp.model.User;

@RestController
@RequestMapping("/rest")
public class DemoRestController {
	
	@RequestMapping(value="/getjson",produces={"application/json;charset=UTF-8"})
	public User getjson(User obj){
		return new User(obj.getId()+1,obj.getName()+"yy");
	}
	
	@RequestMapping(value="getxml",produces={"application/xml;charset=UTF-8"})
	public User getxml(User obj){
		return new User(obj.getId()+1,obj.getName()+"yy");
	}
	
	
	
}
